home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Interactive 7
/
PC World Interactive 7.iso
/
program
/
cprog.EXE
/
CC_1.ZIP
/
CALLOC.C
< prev
next >
Wrap
Text File
|
1988-02-01
|
512b
|
13 lines
/*
** allocate and clear nelem elements of size elsize
*/
extern int malloc();
calloc(nelem, elsize) int nelem, elsize; {
int size;
char *calloc, *ptr;
ptr = calloc = malloc(size = nelem * elsize);
if(calloc) while(size--) *ptr++ = 0;
return calloc;
}